﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace ProjectNocturnalFool
{
    class TitleScreen : UserScreen
    {

        public override void LoadContent()
        {
            base.LoadContent();
            
            int alignCentre;
            int prevCtrl = VirtualScreen.Instance.VirtualHeight / 2 - Constants.ButtonHeight;
            
            BackgroundControl backgroundCtrl = new BackgroundControl();
            backgroundCtrl.LoadContent();
            backgroundCtrl.x = 0;
            backgroundCtrl.y = 0;
            backgroundCtrl.bgColor = Color.Black;
            controls.Add(backgroundCtrl);

            LabelControl labelCtrl = new LabelControl();
            labelCtrl.LoadContent();
            //labelCtrl.message = "GAME"; 
            labelCtrl.bgTexture = TacticsGame.Instance.Content.Load<Texture2D>(Constants.TextureLabelTitle);
            alignCentre = Util.getCentreDrawPointX(x, width, labelCtrl.width);
            labelCtrl.x = alignCentre;
            labelCtrl.y = y + Constants.ControlOffsets;
            controls.Add(labelCtrl);

            ButtonControl buttonCtrl = new ButtonControl();
            buttonCtrl.LoadContent();
            buttonCtrl.style = Button_Style.Basic;
            buttonCtrl.type = Button_Type.TitleCampaignNew;
            alignCentre = Util.getCentreDrawPointX(x, width, buttonCtrl.width);
            buttonCtrl.x = alignCentre;
            buttonCtrl.y = prevCtrl;
            prevCtrl += Constants.ControlSmallOffsets + Constants.ButtonHeight;
            controls.Add(buttonCtrl);

            buttonCtrl = new ButtonControl();
            buttonCtrl.LoadContent();
            buttonCtrl.style = Button_Style.Basic;
            buttonCtrl.type = Button_Type.TitleCampaignLoad;
            alignCentre = Util.getCentreDrawPointX(x, width, buttonCtrl.width);
            buttonCtrl.x = alignCentre;
            buttonCtrl.y = prevCtrl;
            prevCtrl += Constants.ControlSmallOffsets + Constants.ButtonHeight;
            controls.Add(buttonCtrl);

            buttonCtrl = new ButtonControl();
            buttonCtrl.LoadContent();
            buttonCtrl.style = Button_Style.Basic;
            buttonCtrl.type = Button_Type.TitleArenaStart;
            buttonCtrl.x = alignCentre;
            buttonCtrl.y = prevCtrl;
            prevCtrl += Constants.ControlSmallOffsets + Constants.ButtonHeight;
            controls.Add(buttonCtrl);

            buttonCtrl = new ButtonControl();
            buttonCtrl.LoadContent();
            buttonCtrl.style = Button_Style.Basic;
            buttonCtrl.type = Button_Type.TitleOptions;
            buttonCtrl.x = alignCentre;
            buttonCtrl.y = prevCtrl;
            prevCtrl += Constants.ControlSmallOffsets + Constants.ButtonHeight;
            controls.Add(buttonCtrl);

            buttonCtrl = new ButtonControl();
            buttonCtrl.LoadContent();
            buttonCtrl.style = Button_Style.Basic;
            buttonCtrl.type = Button_Type.TitleExitGame;
            alignCentre = Util.getCentreDrawPointX(x, width, buttonCtrl.width);
            buttonCtrl.x = alignCentre;
            buttonCtrl.y = prevCtrl;
            prevCtrl += Constants.ControlSmallOffsets + Constants.ButtonHeight;
            controls.Add(buttonCtrl);                        
        }


    }
}
